#include <stdio.h>
#include <stdlib.h>

int main()
{
	int n=0, i=0, a=0, b=1, c=0, check;
	float x=0;

	printf("Enter the base:");
	check=scanf("%f", &x);
	if (check!=1)
	{
		printf("Incorrect base. Goodbye!\n");
		return -1;
	}
	
	printf("Enter intenger power:");
	check=scanf("%d", &n);
	if (check!=1)
	{
		printf("Incorrect power. Goodbye!\n");
		return -1;
	}

	while (n!=1)
	{
		a=n&1;
		if (a==0) 	
		{
			n=n>>1;
			x=x*x;	
		}
		else 
		{		
			n=n-1;
			b=x*b;
		}
		i++;
	}
	c=x*b;
	printf("answer: %d\n", c);
	system("PAUSE");
}